import 'package:boss/ui/page/commission/page/commissionMode/commission_mode_page.dart';
import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:boss/ui/widget/label_button.dart';
import 'package:flutter/material.dart';
import 'package:hi_common/hi_common.dart';
import 'package:router/annotation.dart';

import 'widget/commission_browser.dart';

@RouterConfig(CommissionPage.pageName)
class CommissionPage extends StatefulWidget {
  static const pageName = '/commissionPage';

  @override
  _CommissionPageState createState() => _CommissionPageState('提成设置');
}

class _CommissionPageState extends BaseState<CommissionPage> {
  _CommissionPageState(String pageName) : super(pageName);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CenterTitleAppBar(
        title: '提成设置',
        actions: <Widget>[
          LabelButton(
            title: '新增提成',
            padding: EdgeInsets.only(left: 8, top: 2, bottom: 2),
            onTap: () {
              Navigator.pushNamed(context, CommissionModePage.pageName);
            },
          ),
        ],
      ),
      body: CommissionBrowser(),
    );
  }
}
